package com.tanhua.server.server;

import com.tanhua.dubbo.api.BaiduApi;
import com.tanhua.server.interceptor.UserHolder;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.stereotype.Service;

@Service
public class BaiduService {
  @DubboReference
  private BaiduApi baiduApi;
    //上报本人地理位置
    public void save(Double latitude, Double longitude, String addr) {
        //1.调api
        Long userId = UserHolder.getUserId();
        //userLocation对象不支持序列化，所以参数只能一个一个传
        //2.把参数依次传入
        baiduApi.save(latitude,longitude,addr,userId);
    }
}
